<?php
/*
 * Sequence Synonyms
 *
 * Copyright (c) 2009 Victor de la Torre (vdelatorre@cnio.es)
 * Dual licensed under the MIT (MIT-LICENSE.txt)
 * and GPL (GPL-LICENSE.txt) licenses.
 * 
 * http://code.google.com/p/ssynonyms/
 *
 */
 
  //includes
  include_once('class/class.rest.php');
  include_once('class/class.ssynonyms.php');
  
    //Get parameters
  $sequence	= trim($_REQUEST['sequence']);
  $program	= (trim($_REQUEST['program']))?trim($_REQUEST['program']):'blastn';
  $database	= trim($_REQUEST['database']);
  
  if (!$sequence)
  	exit;
  	
  $ss = new Ssynonyms($entity,$sequence,$program,$database);

  $blast = simplexml_load_string($ss->callBlast());
 

  $entities = $ss->parseBlastResults($blast);
 
  if ($entities){
  		$ss->formatBlast($entities);
  }
  $ss->deploy();
	
?>